home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
mint
/
lib
/
mntlib44.zoo
/
mntlib
/
sigblock.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-09-05
|
834b
|
59 lines
/* signal blocking stuff for MiNT */
#include <signal.h>
#include <errno.h>
#include <mintbind.h>
#include <unistd.h>
extern int __mint;
extern long _sigpending, _sigmask;
static void checksigs __PROTO((void));
/* checksigs: for TOS: this checks to see if we just unmasked any
* pending signals
*/
static void
checksigs()
{
register int sig;
register long send;
if ((send = (_sigpending & ~_sigmask)) != 0) {
for (sig = 0; sig < NSIG; sig++) {
if (send & (1L << sig))
kill(0, sig);
}
}
}
long
sigsetmask(mask)
long mask;
{
register long omask;
if (__mint)
return Psigsetmask(mask);
omask = _sigmask;
_sigmask = mask;
checksigs();
return omask;
}
long
sigblock(mask)
long mask;
{
register long omask;
if (__mint)
return Psigblock(mask);
omask = _sigmask;
_sigmask |= mask;
return omask;
}